/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package simhya.matheval;

import simhya.matheval.function.FunctionDefinition;
/**
 *
 * @author Luca
 */
public class NullaryFunctionNode extends FunctionNode {
    


    public NullaryFunctionNode(FunctionDefinition function) {
        super(function,0);
    }


    @Override
    void computeValue() {
        super.value = function.compute();
    }

    @Override
    void computeValue(SymbolArray varReference) {
        super.value = function.compute();
    }

    @Override
    void computeValue(int evaluationCode) {
        if (random || super.evaluationCode != evaluationCode) {
            super.evaluationCode = evaluationCode;
            super.value = function.compute();
        }
        
    }

    @Override
    void computeValue(SymbolArray varReference, int evaluationCode) {
        if (random || super.evaluationCode != evaluationCode) {
            super.evaluationCode = evaluationCode;
            super.value = function.compute();
        }
    }

}
